﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZBJF.Warranty.Model;

namespace ZBJF.Warranty.BLL
{
    public partial class InsuranceWarrantyRecordInfoCollectService
    {
        public bool IsExist(long insuranceWarrantyRecordId, byte infoCollectWith, int infoColectItemID)
        {
            return LoadEntities(o => o.InsuranceWarrantyRecordID == insuranceWarrantyRecordId && o.InfoCollectWith == infoCollectWith && o.ID == infoColectItemID).Any();
        }

        public IQueryable<InsuranceWarrantyRecordInfoCollect> LoadByInsuranceWarrantyRecordId(long insuranceWarrantyRecordId)
        {
            return LoadEntities(o => o.InsuranceWarrantyRecordID == insuranceWarrantyRecordId);
        }

        public InsuranceWarrantyRecordInfoCollect Load(long insuranceWarrantyRecordId, byte infoCollectWith,
            int infoColectItemID)
        {
            return LoadEntities(o => o.InsuranceWarrantyRecordID == insuranceWarrantyRecordId && o.InfoCollectWith == infoCollectWith && o.InfoColectItemID == infoColectItemID).FirstOrDefault();
        }

    }
}
